package com.lius.SpringBootStart.controllers;

import com.lius.SpringBootStart.domain.Video;
import com.lius.SpringBootStart.service.VideoService;
import com.lius.SpringBootStart.utils.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/v1/pub/video")
public class VideoController {

    @Autowired
    private VideoService videoService;

    //@RequestMapping(value = "list",method = RequestMethod.GET)
    @GetMapping("list")
    public JsonData list(){
        List<Video> list = this.videoService.listVideo();
        return JsonData.buildSuccess(list);
    }

    @PostMapping("save_video_chapter")
    public JsonData saveVideoChapter(@RequestBody Video video){

        return JsonData.buildSuccess(video);
    }
}
